[XEN] Limit size of Xen heap to 2GB.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 25 Sep 2006 08:31:11 +0000 (09:31 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 25 Sep 2006 08:31:11 +0000 (09:31 +0100)
Avoids stub code created on the stack being unable to
reach targets in main Xen code via direct branches.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/setup.c

index e21b4c23703e8f56fe09bf7e754ed5e9cff34a62..8e69ca32200e74e1ea430c830c79adb9313f268d 100644 (file)
@@ -272,6 +272,13 @@ void __init __start_xen(multiboot_info_t *mbi)
         EARLY_FAIL();
     }
 
+    /*
+     * Since there are some stubs getting built on the stacks which use
+     * direct calls/jumps, the heap must be confined to the lower 2G so
+     * that those branches can reach their targets.
+     */
+    if ( opt_xenheap_megabytes > 2048 )
+        opt_xenheap_megabytes = 2048;
     xenheap_phys_end = opt_xenheap_megabytes << 20;
 
     if ( mbi->flags & MBI_MEMMAP )